﻿@model SubmitReturnRequestModel
@using Nop.Web.Models.Order;

<div class="return-request-modal">
    @if (!String.IsNullOrEmpty(Model.Result))
    {
        <div class="result">
            @Model.Result
        </div>
    }
    else
    {
        using (Html.BeginForm("AjaxReturnRequestInit", "ReturnRequest", new { area = "commerce" }))
        {
            <div class="return-products">
                <h3>@T("ReturnRequests.SelectProduct(s)")</h3>

                <table class="data-table">
                    <thead>
                        <tr>
                            <th class="a-center">
                                @T("ReturnRequests.Products.Name")
                            </th>
                            <th class="a-center">
                                
                            </th>
                            <th class="a-center">
                                @T("ReturnRequests.Products.Price")
                            </th>
                            <th class="a-center">
                                @T("ReturnRequests.Products.Quantity")
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model.Items)
                        {
                            <tr>
                                <td>
                                    <img src="@item.ProductPicture.ImageUrl" title="@item.ProductPicture.Title" alt="@item.ProductPicture.AlternateText" />
                                </td>
                                <td class="a-left">
                                    <a href="@Url.RouteUrl("Product", new { SeName = item.ProductSeName })" title="View details">@item.ProductName</a>
                                    @if (!String.IsNullOrEmpty(item.AttributeInfo))
                                    {
                                        <div class="attributes">
                                            @Html.Raw(item.AttributeInfo)
                                        </div>
                                    }
                                </td>
                                <td class="a-left">
                                    @item.UnitPrice
                                </td>
                                <td class="a-left">
                                    <select name="quantity-@(item.Id)" class="form-control">
                                        @for (int i = 0; i <= item.Quantity; i++)
                                        {
                                            <option value="@(i)">@(i)</option>
                                        }
                                    </select>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
            <div class="return-reasons">
                <h3>@T("ReturnRequests.WhyReturning")</h3>
                <div class="row">
                    <div class="col-sm-6">
                        @Html.LabelFor(model => model.ReturnReason)
                    </div>
                    <div class="col-sm-6">
                        @Html.DropDownListFor(model => model.ReturnReason, Model.AvailableReturnReasons, new { @class = "return-reasons form-control" })
                    </div>
                    <div class="clear"></div>
                    <div class="col-sm-6">
                        @Html.LabelFor(model => model.ReturnAction)
                    </div>
                    <div class="col-sm-6">
                        @Html.DropDownListFor(model => model.ReturnAction, Model.AvailableReturnActions, new { @class = "return-actions form-control" })
                    </div>
                    <div class="clear"></div>
                    <div class="col-sm-6">
                        @Html.LabelFor(model => model.Comments)
                    </div>
                    <div class="col-sm-6">
                        @Html.TextAreaFor(model => model.Comments, new { @class = "comment form-control" })
                        @Html.ValidationMessageFor(model => model.Comments)
                    </div>
                    <div class="clear"></div>
                </div>
                <table>
                    
                    @foreach (var method in Model.ShipmentMethods)
                    {
                        <tr>
                            <td>
                                @Html.RadioButton("ShipmentMethodId", method.Value, method.Selected)
                                <label class="forcheckbox" for=@method.Value>
                                    @method.Text

                                </label>
                            </td>
                        </tr>
                        
                    }
                </table>
            </div>
            <div class="clear">
            </div>
        }
    }
</div>
